package net.qunzhi.modules.cms.service.impl;

import cn.hutool.core.lang.Pair;
import net.qunzhi.common.utils.DateUtils;
import net.qunzhi.modules.cms.entity.TbEquipmentEntity;
import net.qunzhi.modules.cms.query.StateDateQuery;
import net.qunzhi.modules.cms.service.DzFlowDataService;
import net.qunzhi.modules.cms.service.XjFlowDataService;
import net.qunzhi.modules.cms.vo.*;
import net.qunzhi.modules.historyspider.HistorySpiderStarter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import net.qunzhi.common.utils.BaseQuery;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.qunzhi.common.utils.PageUtils;
import net.qunzhi.common.utils.Query;

import net.qunzhi.modules.cms.dao.TbFlowStateDao;
import net.qunzhi.modules.cms.entity.TbFlowStateEntity;
import net.qunzhi.modules.cms.service.TbFlowStateService;

import java.text.ParseException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Function;
import java.util.stream.Collectors;


@Service("tbFlowStateService")
public class TbFlowStateServiceImpl extends ServiceImpl<TbFlowStateDao, TbFlowStateEntity> implements TbFlowStateService {

    protected static Logger logger = LoggerFactory.getLogger(TbFlowStateServiceImpl.class);

    @Autowired
    private DzFlowDataService dzFlowDataService;
    @Autowired
    private XjFlowDataService xjFlowDataService;

    @Override
    public PageUtils queryPage(StateDateQuery query) {
        IPage<TbFlowStateEntity> page = this.page(
                new Query<TbFlowStateEntity>().getPage(query),
                new QueryWrapper<TbFlowStateEntity>()
                        .eq("equipment_id", query.getEquipmentId())
                        .le("time", query.getEndDateTime())
                        .ge("time", query.getStartDateTime())
                        .orderByDesc("time")
        );
        return new PageUtils(page);
    }

    @Override
    public void addFlowData(TbEquipmentEntity entity) {
        try {
            //获取最大时间
            String maxTime = this.baseMapper.getMaxTimeByEquipmentId(entity.getId());
            HistorySpiderStarter.work(entity, maxTime, entity.getFlowTag(), entity.getFlowTag());
        } catch (Exception e) {
            logger.error(e.getMessage());
        } finally {
        }
    }


    /*  cpk*/
    public List<XjWaterSummary> getDailySummaryList(String startDate, String endDate)  {

        List<XjWaterSummary> resultList =new ArrayList<XjWaterSummary>();

        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

        ConcurrentMap<String, Object> xjWaterDrawDailyMap = new ConcurrentHashMap<String,Object>();
        List<Pair<String, Object>> xjWaterDrawDaily = xjFlowDataService.getXjWaterDrawDaily(startDate, endDate);
        if (xjWaterDrawDaily != null){
             xjWaterDrawDailyMap = xjWaterDrawDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        //还有西樵的没算进去
        ConcurrentMap<String, Object> xjDailySellMap = new ConcurrentHashMap<String,Object>();
        List<Pair<String, Object>> xjDailySell = this.baseMapper.getXjDailySellList(startDate, endDate);
        if (xjDailySell != null){
          xjDailySellMap = xjDailySell.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        //西樵的数据在另一个数据源，所以需要另计算
        ConcurrentMap<String, Object> xiQiaoDailyMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> xiQiaoSellDaily = dzFlowDataService.getXiQiaoSellDaily(startDate, endDate);
        if (xiQiaoSellDaily != null){
            xiQiaoDailyMap = xiQiaoSellDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        //将list转为map
        ConcurrentMap<String, XjWaterSummary> xjWaterSupportMap = new ConcurrentHashMap<String,XjWaterSummary>();
        List<XjWaterSummary> dailyWaterSupply = xjFlowDataService.getDailyWaterSupply(startDate, endDate);
        if (dailyWaterSupply != null){
            xjWaterSupportMap = dailyWaterSupply.stream().collect(Collectors.toConcurrentMap(XjWaterSummary::getDateTime, Function.identity()));

        }

        for (int i = 0; i < dateList.size(); i++) {
            XjWaterSummary vo = new XjWaterSummary();
            vo.setDateTime(dateList.get(i));
            vo.setXjTotalWaterSupportDaily(xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXjTotalWaterSupportDaily().toString()));
            vo.setXj1WaterSupportDaily(xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj1WaterSupportDaily().toString()));
            vo.setXj2WaterSupportDaily(xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj2WaterSupportDaily().toString()));
            vo.setXjWaterSellDaily((xjDailySellMap.get(dateList.get(i))==null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())) + (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString())));
            vo.setXjWaterDrawDaily(xjWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterDrawDailyMap.get(dateList.get(i)).toString()));
            resultList.add(vo);
        }
        return resultList;
    }


    @Override
    public List<WaterSellConditionOfEachFlowmeterVO> getWaterSellConditionOfEachFlowmeter(String startDate, String endDate)  {

        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

        ConcurrentMap<String, Object> sanShuiErQiaoNanDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiErQiaoNanDailySellWater = this.baseMapper.getDaliyFlowById(3, startDate, endDate);
        if (sanShuiErQiaoNanDailySellWater != null){
             sanShuiErQiaoNanDailySellWaterMap = sanShuiErQiaoNanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> qingQiDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> qingQiDailySellWater = this.baseMapper.getDaliyFlowById(4, startDate, endDate);
        if (qingQiDailySellWater != null){
            qingQiDailySellWaterMap =qingQiDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object>  dongMenDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> dongMenDailySellWater = this.baseMapper.getCopyDailyFlowByAreaId(19, startDate, endDate);
        if (dongMenDailySellWater != null){
            dongMenDailySellWaterMap = dongMenDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object>  danHengDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> danHengDailySellWater = this.baseMapper.getDaliyFlowById(5, startDate, endDate);
        if(danHengDailySellWater != null){
            danHengDailySellWaterMap = danHengDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));

        }

        ConcurrentMap<String, Object> jianShaDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> jianShaDailySellWater = this.baseMapper.getDaliyFlowById(6, startDate, endDate);
        if (jianShaDailySellWater != null){
            jianShaDailySellWaterMap = jianShaDailySellWater.stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> yinHuiHuaTingDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> yinHuiHuaTingDailySellWater = this.baseMapper.getDaliyFlowById(7, startDate, endDate);
        if (yinHuiHuaTingDailySellWater != null){
            yinHuiHuaTingDailySellWaterMap = yinHuiHuaTingDailySellWater.stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> paiGuanZhanDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> paiGuanZhanDailySellWater = this.baseMapper.getDaliyFlowById(8, startDate, endDate);
        if (paiGuanZhanDailySellWater != null){
            paiGuanZhanDailySellWaterMap = paiGuanZhanDailySellWater.stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }



        ConcurrentMap<String, Object>  zhiNanCunZongShuiBiaoDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> zhiNanCunZongShuiBiaoDailySellWater = this.baseMapper.getCopyDailyFlowByAreaId(20, startDate, endDate);
        if (zhiNanCunZongShuiBiaoDailySellWater != null){
            zhiNanCunZongShuiBiaoDailySellWaterMap = zhiNanCunZongShuiBiaoDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }



        ConcurrentMap<String, Object> nanZhuangJiHuaLuDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> nanZhuangJiHuaLuDailySellWater = this.baseMapper.getDaliyFlowById(9, startDate, endDate);
        if (nanZhuangJiHuaLuDailySellWater != null){
            nanZhuangJiHuaLuDailySellWaterMap = nanZhuangJiHuaLuDailySellWater.stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, WaterSellConditionOfEachFlowmeterVO>  pumpStationHeaderMap = new ConcurrentHashMap<>();
        List<WaterSellConditionOfEachFlowmeterVO> pumpStationHeader = dzFlowDataService.getPumpStationHeader(startDate, endDate);
        if (pumpStationHeader != null){
            pumpStationHeaderMap = pumpStationHeader.stream().collect(Collectors.toConcurrentMap(WaterSellConditionOfEachFlowmeterVO::getDateTime, Function.identity()));
        }


        List<WaterSellConditionOfEachFlowmeterVO> resultList = new ArrayList<WaterSellConditionOfEachFlowmeterVO>();
        for (int i = 0; i < dateList.size(); i++) {
            WaterSellConditionOfEachFlowmeterVO vo = new WaterSellConditionOfEachFlowmeterVO();
            vo.setDateTime(dateList.get(i));
            vo.setSanShuiErQiaoNanDailySellWater(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString()));
            vo.setQingQiDailySellWater(qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(qingQiDailySellWaterMap.get(dateList.get(i)).toString()));
            vo.setDongMenDailySellWater(dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(dongMenDailySellWaterMap.get(dateList.get(i)).toString()));
            vo.setDanHengDailySellWater(danHengDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danHengDailySellWaterMap.get(dateList.get(i)).toString()));
            vo.setJianShaDailySellWater(jianShaDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jianShaDailySellWaterMap.get(dateList.get(i)).toString()));
            vo.setYinHuiHuaTingDailySellWater(yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)).toString()));
            vo.setPaiGuanZhanDailySellWater(paiGuanZhanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(paiGuanZhanDailySellWaterMap.get(dateList.get(i)).toString()));
            vo.setZhiNanCunZongShuiBiaoDailySellWater(zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)).toString()));
            vo.setNanZhuangJiHuaLuDailySellWater(nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)).toString()));
            vo.setXiQiaoDailySellWater(pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getXiQiaoDailySellWater().toString()));
            vo.setJinShaDanZaoDailyWaterOutlet(pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getJinShaDanZaoDailyWaterOutlet().toString()));
            vo.setChanChengWaterOutlet(pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getChanChengWaterOutlet().toString()));
            vo.setPressurePumpInlet(pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getPressurePumpInlet().toString()));
            resultList.add(vo);
        }
        return resultList;
    }


    @Override
    public List<PercentageOfWaterInEachAreaVO> getPercentageOfWaterInEachArea(String startDate, String endDate) {
        List<PercentageOfWaterInEachAreaVO> resultList = new ArrayList<PercentageOfWaterInEachAreaVO>();
        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

        //各片区售水
        ConcurrentMap<String, Object> percentageOfSanShuiMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiDailyFlow = this.baseMapper.getSanShuiDailyFlow(startDate, endDate);
        if (sanShuiDailyFlow != null){
            percentageOfSanShuiMap = sanShuiDailyFlow .stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> percentageOfDanZaoMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> danZaoDailyFlow = this.baseMapper.getDanZaoDailyFlow(startDate, endDate);
        if (danZaoDailyFlow != null){
            percentageOfDanZaoMap = danZaoDailyFlow.stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> percentageOfJinShaMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> jinShaDailyFlow = this.baseMapper.getJinShaDailyFlow(startDate, endDate);
        if (jinShaDailyFlow != null){
            percentageOfJinShaMap = jinShaDailyFlow.stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> percentageOfChanChengMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> chanchengDailyFlow = this.baseMapper.getChanchengDailyFlow(startDate, endDate);
        if (chanchengDailyFlow != null){
            percentageOfChanChengMap = chanchengDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xjDailySellMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xjDailySellList = this.baseMapper.getXjDailySellList(startDate, endDate);

        if ( xjDailySellList != null){
            xjDailySellMap = xjDailySellList.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xiQiaoDailyMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> xiQiaoSellDaily = dzFlowDataService.getXiQiaoSellDaily(startDate, endDate);
        if (xiQiaoSellDaily!= null){
            xiQiaoDailyMap = xiQiaoSellDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        for (int i = 0; i < dateList.size(); i++) {
            PercentageOfWaterInEachAreaVO vo = new PercentageOfWaterInEachAreaVO();
            vo.setDateTime(dateList.get(i));
            vo.setPercentageOfSanShui((percentageOfSanShuiMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(percentageOfSanShuiMap.get(dateList.get(i)).toString())) /
                   (
                    (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())) +
                            (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()))
                    ));


            vo.setPercentageOfDanZao((percentageOfDanZaoMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(percentageOfDanZaoMap.get(dateList.get(i)).toString())) /
                    (
                            (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())) +
                                    (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()))
                    ));

            vo.setPercentageOfJinSha((percentageOfJinShaMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(percentageOfJinShaMap.get(dateList.get(i)).toString())) /
                    (
                            (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())) +
                                    (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()))
                    ));

            vo.setPercentageOfChanCheng( (percentageOfChanChengMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble( percentageOfChanChengMap.get(dateList.get(i)).toString()))/
                    (
                            (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())) +
                                    (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()))
                    ));

            vo.setPercentageOfXiQiao( (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()))/
                    (
                            (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())) +
                                    (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()))
                    ));
            resultList.add(vo);
        }
        return resultList;
    }


    @Override
    public List<DailyFlowOfEachAreaVO> getDailyFlowOfEachArea(String startDate, String endDate)  {
        List<DailyFlowOfEachAreaVO> resultList = new ArrayList<DailyFlowOfEachAreaVO>();
        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

        //各片区售水
        ConcurrentMap<String, Object> sanShuiMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiDailyFlow = this.baseMapper.getSanShuiDailyFlow(startDate, endDate);
        if ( sanShuiDailyFlow != null){
            sanShuiMap = sanShuiDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> danZaoMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> danZaoDailyFlow = this.baseMapper.getDanZaoDailyFlow(startDate, endDate);
        if ( danZaoDailyFlow != null){
            danZaoMap = danZaoDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object>  jinShaMap  = new ConcurrentHashMap<>();
        List<Pair<String, Object>> jinShaDailyFlow = this.baseMapper.getJinShaDailyFlow(startDate, endDate);
        if (jinShaDailyFlow != null){
            jinShaMap = jinShaDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> chanChengMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> chanchengDailyFlow = this.baseMapper.getChanchengDailyFlow(startDate, endDate);
        if (chanchengDailyFlow != null){
            chanChengMap = chanchengDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xiQiaoDailyMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xiQiaoSellDaily = dzFlowDataService.getXiQiaoSellDaily(startDate, endDate);
        if ( xiQiaoSellDaily != null){
            xiQiaoDailyMap = xiQiaoSellDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xjDailySellMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xjDailySellList = this.baseMapper.getXjDailySellList(startDate, endDate);
        if (xjDailySellList != null){
            xjDailySellMap =  xjDailySellList.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, XjWaterSummary> xjWaterSupportMap = new ConcurrentHashMap<>();
        List<XjWaterSummary> dailyWaterSupply = xjFlowDataService.getDailyWaterSupply(startDate, endDate);
        if (  dailyWaterSupply != null){
            xjWaterSupportMap = dailyWaterSupply.stream().collect(Collectors.toConcurrentMap(XjWaterSummary::getDateTime, Function.identity()));
        }


        ConcurrentMap<String, Object> nanJiangTotalMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> nanJiangDailyFlow = this.baseMapper.getNanJiangDailyFlow(startDate, endDate);
        if ( nanJiangDailyFlow != null){
            nanJiangTotalMap =  nanJiangDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        for (int i = 0; i < dateList.size(); i++) {
            DailyFlowOfEachAreaVO vo = new DailyFlowOfEachAreaVO();
            vo.setDateTime(dateList.get(i));
            vo.setDailyFlowOfSanShui(sanShuiMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiMap.get(dateList.get(i)).toString()));
            vo.setDailyFlowOfDanZao(danZaoMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danZaoMap.get(dateList.get(i)).toString()));
            vo.setDailyFlowOfJinSha(jinShaMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jinShaMap.get(dateList.get(i)).toString()));
            vo.setDailyFlowOfChanCheng(chanChengMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(chanChengMap.get(dateList.get(i)).toString()));
            vo.setDailyFlowOfXiQiao(xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()));
            vo.setXjTotalPWaterSellDaily((xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()))+(xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())));
            vo.setXjTotalPWaterSupportDaily(xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXjTotalWaterSupportDaily().toString()));
            vo.setNanJiangTotal(nanJiangTotalMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(nanJiangTotalMap.get(dateList.get(i)).toString()));
            vo.setSaleOfDifference((xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXjTotalWaterSupportDaily().toString())) -
                    ((xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString())) + (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString()))));
            resultList.add(vo);
        }
        return resultList;
    }



    @Override
    public List<MonthlyCumulativeWaterOfEachAreaVO> getMonthlyCumulativeWaterOfEachArea(String startDate, String endDate) {
        List<MonthlyCumulativeWaterOfEachAreaVO> resultList = new ArrayList<MonthlyCumulativeWaterOfEachAreaVO>();
        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

     /*   Double CumulativeWaterOfSanShui = Double.parseDouble(this.baseMapper.getCumulativeWaterOfSanShui(startDate).toString());
        Double CumulativeWaterOfDanZao = Double.parseDouble(this.baseMapper.getCumulativeWaterOfDanZao(startDate).toString());
        Double CumulativeWaterOfJinSha = Double.parseDouble(this.baseMapper.getCumulativeWaterOfJinSha(startDate).toString());
        Double CumulativeWaterOfChanCheng = Double.parseDouble(this.baseMapper.getCumulativeWaterOfChanCheng(startDate).toString());
        Double CumulativeWaterOfXiQiao = Double.parseDouble(dzFlowDataService.getCumulativeWaterOfXiQiao(startDate).toString());
        Double CumulativeWaterOfXjSupply = Double.parseDouble(xjFlowDataService.getCumulativeWaterOfXjSupply(startDate).toString());
        Double CumulativeWaterOfXjSell = CumulativeWaterOfSanShui+CumulativeWaterOfDanZao+CumulativeWaterOfJinSha+CumulativeWaterOfChanCheng+CumulativeWaterOfXiQiao;
        Double CumulativeWaterOfXjDraw = Double.parseDouble(xjFlowDataService.getCumulativeWaterOfXjDraw(startDate).toString());
*/

        Double CumulativeWaterOfSanShui = 0.0;
        Double CumulativeWaterOfDanZao = 0.0;
        Double CumulativeWaterOfJinSha =  0.0;
        Double CumulativeWaterOfChanCheng =  0.0;
        Double CumulativeWaterOfXiQiao = 0.0;
        Double CumulativeWaterOfXjSupply =  0.0;
        Double CumulativeWaterOfXjSell =  0.0;
        Double CumulativeWaterOfXjDraw =  0.0;


        ConcurrentMap<String, Object> sanShuiMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiDailyFlow = this.baseMapper.getSanShuiDailyFlow(startDate, endDate);
        if ( sanShuiDailyFlow != null){
            sanShuiMap = sanShuiDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> danZaoMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> danZaoDailyFlow = this.baseMapper.getDanZaoDailyFlow(startDate, endDate);
        if ( danZaoDailyFlow != null){
            danZaoMap = danZaoDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object>  jinShaMap  = new ConcurrentHashMap<>();
        List<Pair<String, Object>> jinShaDailyFlow = this.baseMapper.getJinShaDailyFlow(startDate, endDate);
        if (jinShaDailyFlow != null){
            jinShaMap = jinShaDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> chanChengMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> chanchengDailyFlow = this.baseMapper.getChanchengDailyFlow(startDate, endDate);
        if (chanchengDailyFlow != null){
            chanChengMap = chanchengDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xiQiaoDailyMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xiQiaoSellDaily = dzFlowDataService.getXiQiaoSellDaily(startDate, endDate);
        if ( xiQiaoSellDaily != null){
            xiQiaoDailyMap = xiQiaoSellDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xjDailySellMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xjDailySellList = this.baseMapper.getXjDailySellList(startDate, endDate);
        if (xjDailySellList != null){
            xjDailySellMap =  xjDailySellList.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, XjWaterSummary> xjWaterSupportMap = new ConcurrentHashMap<>();
        List<XjWaterSummary> dailyWaterSupply = xjFlowDataService.getDailyWaterSupply(startDate, endDate);
        if (  dailyWaterSupply != null){
            xjWaterSupportMap = dailyWaterSupply.stream().collect(Collectors.toConcurrentMap(XjWaterSummary::getDateTime, Function.identity()));
        }



        ConcurrentMap<String, Object> xjWaterDrawDailyMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> xjWaterDrawDaily = xjFlowDataService.getXjWaterDrawDaily(startDate, endDate);

        if (xjWaterDrawDaily != null){
            xjWaterDrawDailyMap = xjWaterDrawDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }



        //这里可以做优化，因为resultlist中存储了前一天的累计水量，可以不需要定义那么多的变量
        for (int i = 0; i < dateList.size(); i++) {
            MonthlyCumulativeWaterOfEachAreaVO vo = new MonthlyCumulativeWaterOfEachAreaVO();
            CumulativeWaterOfSanShui += (sanShuiMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiMap.get(dateList.get(i)).toString()));
            CumulativeWaterOfDanZao += (danZaoMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danZaoMap.get(dateList.get(i)).toString()));
            CumulativeWaterOfJinSha += (jinShaMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jinShaMap.get(dateList.get(i)).toString()));
            CumulativeWaterOfChanCheng += (chanChengMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(chanChengMap.get(dateList.get(i)).toString()));
            CumulativeWaterOfXiQiao += (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()));
            CumulativeWaterOfXjSupply += (xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXjTotalWaterSupportDaily().toString()));
            CumulativeWaterOfXjSell += (xjDailySellMap.get(dateList.get(i))==null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())) + (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()));
            CumulativeWaterOfXjDraw +=  (xjWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterDrawDailyMap.get(dateList.get(i)).toString()));

            vo.setDateTime(dateList.get(i));
            vo.setMonthlyCumulativeWaterOfSanShui(CumulativeWaterOfSanShui);
            vo.setMonthlyCumulativeWaterOfDanZao(CumulativeWaterOfDanZao);
            vo.setMonthlyCumulativeWaterOfJinSha(CumulativeWaterOfJinSha);
            vo.setMonthlyCumulativeWaterOfChanCheng(CumulativeWaterOfChanCheng);
            vo.setMonthlyCumulativeWaterOfXiQiao(CumulativeWaterOfXiQiao);
            vo.setXjCumulativePWaterSupportMonthly(CumulativeWaterOfXjSupply);
            vo.setXjCumulativePWaterSellMonthly(CumulativeWaterOfXjSell);
            vo.setXjCumulativeWaterDrawMonthly(CumulativeWaterOfXjDraw);
            resultList.add(vo);
        }
        return resultList;
    }

    @Override
    public List<SalesOutputRatioOfEachAreaVO> getSalesOutputRatioOfEachArea(String startDate, String endDate)  {

        List<SalesOutputRatioOfEachAreaVO> resultList = new ArrayList<SalesOutputRatioOfEachAreaVO>();
        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

  /*      Double CumulativeWaterOfSanShui = Double.parseDouble(this.baseMapper.getCumulativeWaterOfSanShui(startDate).toString());
        Double CumulativeWaterOfDanZao = Double.parseDouble(this.baseMapper.getCumulativeWaterOfDanZao(startDate).toString());
        Double CumulativeWaterOfJinSha = Double.parseDouble(this.baseMapper.getCumulativeWaterOfJinSha(startDate).toString());
        Double CumulativeWaterOfChanCheng = Double.parseDouble(this.baseMapper.getCumulativeWaterOfChanCheng(startDate).toString());
        Double CumulativeWaterOfXiQiao = Double.parseDouble(dzFlowDataService.getCumulativeWaterOfXiQiao(startDate).toString());
        Double CumulativeWaterOfXjSupply = Double.parseDouble(xjFlowDataService.getCumulativeWaterOfXjSupply(startDate).toString());
        Double CumulativeWaterOfXjSell = CumulativeWaterOfSanShui+CumulativeWaterOfDanZao+CumulativeWaterOfJinSha+CumulativeWaterOfChanCheng+CumulativeWaterOfXiQiao;
*/

        Double CumulativeWaterOfXjSupply = 0.0;
        Double CumulativeWaterOfXjSell = 0.0;
        Double CumulativeWaterOfXjDraw = 0.0;

        ConcurrentMap<String, Object> sanShuiMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiDailyFlow = this.baseMapper.getSanShuiDailyFlow(startDate, endDate);
        if ( sanShuiDailyFlow != null){
            sanShuiMap = sanShuiDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> danZaoMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> danZaoDailyFlow = this.baseMapper.getDanZaoDailyFlow(startDate, endDate);
        if ( danZaoDailyFlow != null){
            danZaoMap = danZaoDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object>  jinShaMap  = new ConcurrentHashMap<>();
        List<Pair<String, Object>> jinShaDailyFlow = this.baseMapper.getJinShaDailyFlow(startDate, endDate);
        if (jinShaDailyFlow != null){
            jinShaMap = jinShaDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> chanChengMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> chanchengDailyFlow = this.baseMapper.getChanchengDailyFlow(startDate, endDate);
        if (chanchengDailyFlow != null){
            chanChengMap = chanchengDailyFlow.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xiQiaoDailyMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xiQiaoSellDaily = dzFlowDataService.getXiQiaoSellDaily(startDate, endDate);
        if ( xiQiaoSellDaily != null){
            xiQiaoDailyMap = xiQiaoSellDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> sanShuiErQiaoNanDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiErQiaoNanDailySellWater = this.baseMapper.getDaliyFlowById(3, startDate, endDate);
        if (sanShuiErQiaoNanDailySellWater != null){
            sanShuiErQiaoNanDailySellWaterMap = sanShuiErQiaoNanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> qingQiDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> qingQiDailySellWater = this.baseMapper.getDaliyFlowById(4, startDate, endDate);
        if (qingQiDailySellWater != null){
            qingQiDailySellWaterMap =qingQiDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object>  dongMenDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> dongMenDailySellWater = this.baseMapper.getCopyDailyFlowByAreaId(19, startDate, endDate);
        if (dongMenDailySellWater != null){
            dongMenDailySellWaterMap = dongMenDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, WaterSellConditionOfEachFlowmeterVO>  pumpStationHeaderMap = new ConcurrentHashMap<>();
        List<WaterSellConditionOfEachFlowmeterVO> pumpStationHeader = dzFlowDataService.getPumpStationHeader(startDate, endDate);
        if (pumpStationHeader != null){
            pumpStationHeaderMap = pumpStationHeader.stream().collect(Collectors.toConcurrentMap(WaterSellConditionOfEachFlowmeterVO::getDateTime, Function.identity()));
        }


        ConcurrentMap<String, Object> xjDailySellMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xjDailySellList = this.baseMapper.getXjDailySellList(startDate, endDate);
        if (xjDailySellList != null){
            xjDailySellMap =  xjDailySellList.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, XjWaterSummary> xjWaterSupportMap = new ConcurrentHashMap<>();
        List<XjWaterSummary> dailyWaterSupply = xjFlowDataService.getDailyWaterSupply(startDate, endDate);
        if (  dailyWaterSupply != null){
            xjWaterSupportMap = dailyWaterSupply.stream().collect(Collectors.toConcurrentMap(XjWaterSummary::getDateTime, Function.identity()));
        }

        ConcurrentMap<String, Object>  xjWaterDrawDailyMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> xjWaterDrawDaily = xjFlowDataService.getXjWaterDrawDaily(startDate, endDate);
        if ( xjWaterDrawDaily != null){
            xjWaterDrawDailyMap = xjWaterDrawDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }



/*        ConcurrentMap<String, Object> xjWaterDrawDailyMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> xjWaterDrawDaily = xjFlowDataService.getXjWaterDrawDaily(startDate, endDate);
        if (xjWaterDrawDaily != null){
            xjWaterDrawDailyMap = xjWaterDrawDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }*/



      /*  ConcurrentMap<String, MonthlyCumulativeWaterOfEachAreaVO> monthlyCumulativeWaterOfEachAreaMap = getMonthlyCumulativeWaterOfEachArea(startDate, endDate).stream().collect(Collectors.toConcurrentMap(MonthlyCumulativeWaterOfEachAreaVO::getDateTime, Function.identity()));
        if (monthlyCumulativeWaterOfEachAreaMap == null){
            monthlyCumulativeWaterOfEachAreaMap = new ConcurrentHashMap<>();
        }
*/

        for (int i = 0; i < dateList.size(); i++) {
            SalesOutputRatioOfEachAreaVO vo = new SalesOutputRatioOfEachAreaVO();

            CumulativeWaterOfXjSupply += (xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXjTotalWaterSupportDaily().toString()));
            CumulativeWaterOfXjSell += (xjDailySellMap.get(dateList.get(i))==null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())) + (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()));
            CumulativeWaterOfXjDraw +=  (xjWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterDrawDailyMap.get(dateList.get(i)).toString()));

            vo.setDateTime(dateList.get(i));
            vo.setDailyHighProductionAndSalesDiffer((
                    (xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj2WaterSupportDaily().toString())) -
                            (sanShuiMap.get(dateList.get(i)) == null ? 0 : Double.parseDouble(sanShuiMap.get(dateList.get(i)).toString()))) / (xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj2WaterSupportDaily().toString())) * 100);

            vo.setDailyLowProductionAndSalesDiffer((
                    (xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj1WaterSupportDaily().toString())) -
                            (danZaoMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danZaoMap.get(dateList.get(i)).toString())) -
                            (jinShaMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jinShaMap.get(dateList.get(i)).toString())) -
                            (chanChengMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(chanChengMap.get(dateList.get(i)).toString())) -
                            (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()))) / (xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj1WaterSupportDaily().toString())) * 100);

            vo.setDailyLowLeakRate(((xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj1WaterSupportDaily().toString())) - (pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getPressurePumpInlet().toString())))/(xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj1WaterSupportDaily().toString())) * 100);

            vo.setDailyHighLeakRate(((xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj2WaterSupportDaily().toString())) -
                    (sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString())) -
                    (qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(qingQiDailySellWaterMap.get(dateList.get(i)).toString())) -
                    (dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(dongMenDailySellWaterMap.get(dateList.get(i)).toString()))) / (xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj2WaterSupportDaily().toString())) * 100);

            vo.setDailyProductionAndSalesDifferOfPumpStation(((pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getPressurePumpInlet().toString())) -
                    (danZaoMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danZaoMap.get(dateList.get(i)).toString())) -
                    (jinShaMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jinShaMap.get(dateList.get(i)).toString())) -
                    (chanChengMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(chanChengMap.get(dateList.get(i)).toString())) -
                    (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString()))) / (pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getPressurePumpInlet().toString())) * 100);

            vo.setDailyProductionAndSalesDifferOfSanShui(((xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj2WaterSupportDaily().toString())) - (sanShuiMap.get(dateList.get(i)) == null ? 0 : Double.parseDouble(sanShuiMap.get(dateList.get(i)).toString()))) / (xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXj2WaterSupportDaily().toString())) * 100);

            vo.setDailyProductionAndSalesDifferOfJinSha(((pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getJinShaDanZaoDailyWaterOutlet().toString())) -
                    (danZaoMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danZaoMap.get(dateList.get(i)).toString())) -
                    (jinShaMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jinShaMap.get(dateList.get(i)).toString()))) / (pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getJinShaDanZaoDailyWaterOutlet().toString())) * 100);

            vo.setDailyProductionAndSalesDifferOfChanCheng(((pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getChanChengWaterOutlet().toString())) - (chanChengMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(chanChengMap.get(dateList.get(i)).toString()))) / (pumpStationHeaderMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pumpStationHeaderMap.get(dateList.get(i)).getChanChengWaterOutlet().toString())) * 100);
            //salesOutputRatioOfEachAreaVO.setDailyProductionAndSalesDifferOfXiQiao((pumpStationList.get(i).getXiQiaoDailySellWater()-pumpStationList.get(i).getXiQiaoDailySellWater())/pumpStationList.get(i).getXiQiaoDailySellWater()*100);
            vo.setDailyProductionAndSalesDifferOfXiQiao(0.0);

           /* vo.setAccumulatedProductionAndSalesDiffer(((monthlyCumulativeWaterOfEachAreaMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(monthlyCumulativeWaterOfEachAreaMap.get(dateList.get(i)).getXjCumulativePWaterSupportMonthly().toString()))-
                    (monthlyCumulativeWaterOfEachAreaMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(monthlyCumulativeWaterOfEachAreaMap.get(dateList.get(i)).getXjCumulativePWaterSellMonthly().toString())))/
                    (monthlyCumulativeWaterOfEachAreaMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(monthlyCumulativeWaterOfEachAreaMap.get(dateList.get(i)).getXjCumulativePWaterSupportMonthly().toString()))*100);
           */
            //以上注释代码用以下一句来替代速度会快点，否则要查很多无关的数据

            vo.setAccumulatedProductionAndSalesDiffer((CumulativeWaterOfXjSupply-CumulativeWaterOfXjSell)/CumulativeWaterOfXjSupply*100);

            vo.setDailyTotalProductionAndSalesDiffer(((xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXjTotalWaterSupportDaily().toString()))-
                    (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())) -
                    (xiQiaoDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailyMap.get(dateList.get(i)).toString())))/(xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXjTotalWaterSupportDaily().toString()))*100);
            vo.setTapWater((xjWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterDrawDailyMap.get(dateList.get(i)).toString())) - (xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXjTotalWaterSupportDaily().toString())));
            vo.setTapWaterRate(vo.getTapWater() / (xjWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjWaterSupportMap.get(dateList.get(i)).getXjTotalWaterSupportDaily().toString())) * 100);
            vo.setCumulativeTapWaterRate((CumulativeWaterOfXjDraw-CumulativeWaterOfXjSupply)/CumulativeWaterOfXjSupply*100);
            resultList.add(vo);
        }
        return resultList;
    }

    @Override
    public List<MorningWaterVO> getFlowRateOfEachFlowmeterAtDawn(String startDate, String endDate)  {
        List<MorningWaterVO> resultList = new ArrayList<MorningWaterVO>();
        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);



        ConcurrentMap<String, Object> morningWaterOfDanHengMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> morningWaterOfDanHeng  = this.baseMapper.getMorningWaterOfFlowMeterById(5, startDate, endDate);
        if (morningWaterOfDanHeng != null){
            morningWaterOfDanHengMap =  morningWaterOfDanHeng.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> morningWaterOfJianShaMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> morningWaterOfJianSha = this.baseMapper.getMorningWaterOfFlowMeterById(6, startDate, endDate);
        if (morningWaterOfJianSha != null){
            morningWaterOfJianShaMap =  morningWaterOfJianSha.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> morningWaterOfXjMap  = new ConcurrentHashMap<>();
        List<Pair<String, Object>> morningWaterOfXj = xjFlowDataService.getMorningWaterOfXj(startDate, endDate);
        if (morningWaterOfXj != null){
            morningWaterOfXjMap =  morningWaterOfXj.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> morningWaterOfPaiGuanZhanMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> morningWaterOfPaiGuanZhan = this.baseMapper.getMorningWaterOfFlowMeterById(8, startDate, endDate);
        if (morningWaterOfPaiGuanZhan != null){
            morningWaterOfPaiGuanZhanMap =   morningWaterOfPaiGuanZhan.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> morningWaterOfNanZhuangMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> morningWaterOfNanZhuang = this.baseMapper.getMorningWaterOfFlowMeterById(9, startDate, endDate);
        if (morningWaterOfNanZhuang != null){
            morningWaterOfNanZhuangMap = morningWaterOfNanZhuang.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> morningWaterOfQingQiMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> morningWaterOfQingQi = this.baseMapper.getMorningWaterOfFlowMeterById(4, startDate, endDate);
        if (morningWaterOfQingQi != null){
            morningWaterOfQingQiMap =  morningWaterOfQingQi
                    .stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }



        for (int i = 0; i < dateList.size(); i++) {
            MorningWaterVO morningWaterVO = new MorningWaterVO();
            morningWaterVO.setDateTime(dateList.get(i));
            morningWaterVO.setMorningWaterOfDanHeng((morningWaterOfDanHengMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(morningWaterOfDanHengMap.get(dateList.get(i)).toString())));
            morningWaterVO.setMorningWaterOfJianSha((morningWaterOfJianShaMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(morningWaterOfJianShaMap.get(dateList.get(i)).toString())));
            morningWaterVO.setMorningWaterOfXj((morningWaterOfXjMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(morningWaterOfXjMap.get(dateList.get(i)).toString())));
            morningWaterVO.setMorningWaterOfPaiGuanZhan((morningWaterOfPaiGuanZhanMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(morningWaterOfPaiGuanZhanMap.get(dateList.get(i)).toString())));
            morningWaterVO.setMorningWaterOfNanZhuang((morningWaterOfNanZhuangMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(morningWaterOfNanZhuangMap.get(dateList.get(i)).toString())));
            morningWaterVO.setMorningWaterOfQingQi((morningWaterOfQingQiMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(morningWaterOfQingQiMap.get(dateList.get(i)).toString())));
            resultList.add(morningWaterVO);
        }
        return resultList;
    }


    //获取手抄的列表


    @Override
    public List<XjWaterSummary> getCopyDailySummaryList(String startDate, String endDate) {
        List<XjWaterSummary> resultList =new ArrayList<XjWaterSummary>();
        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

        ConcurrentMap<String, Object> xj1CopyWaterSupportMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj1CopyWaterSupport = this.baseMapper.getCopyDailyFlowById(17, startDate, endDate);
        if (xj1CopyWaterSupport != null){
            xj1CopyWaterSupportMap =  xj1CopyWaterSupport.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xj2CopyWaterSupportMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj2CopyWaterSupport = this.baseMapper.getCopyDailyFlowById(18, startDate, endDate);
        if (xj2CopyWaterSupport  != null){
            xj2CopyWaterSupportMap =  xj2CopyWaterSupport.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xj1CopyWaterDrawDailyMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj1CopyWaterDrawDaily = this.baseMapper.getCopyDailyFlowById(1, startDate, endDate);
        if (xj1CopyWaterDrawDaily  != null){
            xj1CopyWaterDrawDailyMap = xj1CopyWaterDrawDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xj2CopyWaterDrawDailyMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj2CopyWaterDrawDaily = this.baseMapper.getCopyDailyFlowById(2, startDate, endDate);
        if(xj2CopyWaterDrawDaily  != null){
            xj2CopyWaterDrawDailyMap = xj2CopyWaterDrawDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xjDailySellMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>>  xjDailySell = this.baseMapper.getCopyXjDailySellList(startDate, endDate);
        if (xjDailySell != null){
            xjDailySellMap = xjDailySell.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        for (int i =0;i<dateList.size();i++){
            XjWaterSummary xjWaterSummary = new XjWaterSummary();
            xjWaterSummary.setDateTime(dateList.get(i));
            xjWaterSummary.setXjTotalWaterSupportDaily((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString()))+(xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString())));
            xjWaterSummary.setXj1WaterSupportDaily((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString())));
            xjWaterSummary.setXj2WaterSupportDaily((xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString())));
            xjWaterSummary.setXjWaterSellDaily((xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())));
            xjWaterSummary.setXjWaterDrawDaily((xj1CopyWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterDrawDailyMap.get(dateList.get(i)).toString()))+(xj2CopyWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterDrawDailyMap.get(dateList.get(i)).toString())));
            resultList.add(xjWaterSummary);
        }
            return resultList;
    }

    @Override
    public List<WaterSellConditionOfEachFlowmeterVO> getCopyWaterSellConditionOfEachFlowmeter(String startDate, String endDate) {
        List<WaterSellConditionOfEachFlowmeterVO> resultList =new ArrayList<WaterSellConditionOfEachFlowmeterVO>();
        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

        ConcurrentMap<String, Object> sanShuiErQiaoNanDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiErQiaoNanDailySellWater = this.baseMapper.getCopyDailyFlowById(3, startDate, endDate);
        if (sanShuiErQiaoNanDailySellWater != null){
            sanShuiErQiaoNanDailySellWaterMap =  sanShuiErQiaoNanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> qingQiDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> qingQiDailySellWater = this.baseMapper.getCopyDailyFlowById(4, startDate, endDate);
        if (qingQiDailySellWater != null){
            qingQiDailySellWaterMap = qingQiDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> dongMenDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> dongMenDailySellWater = this.baseMapper.getCopyDailyFlowById(19, startDate, endDate);
        if (dongMenDailySellWater != null){
            dongMenDailySellWaterMap =     dongMenDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));

        }

        ConcurrentMap<String, Object> danHengDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> danHengDailySellWater = this.baseMapper.getCopyDailyFlowById(5, startDate, endDate);
        if (danHengDailySellWater != null){
            danHengDailySellWaterMap =  danHengDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> jianShaDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> jianShaDailySellWater = this.baseMapper.getCopyDailyFlowById(6, startDate, endDate);
        if (jianShaDailySellWater != null){
            jianShaDailySellWaterMap =  jianShaDailySellWater
                    .stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> yinHuiHuaTingDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> yinHuiHuaTingDailySellWater = this.baseMapper.getCopyDailyFlowById(7, startDate, endDate);
        if (yinHuiHuaTingDailySellWater != null){
            yinHuiHuaTingDailySellWaterMap =  yinHuiHuaTingDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> paiGuanZhanDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> paiGuanZhanDailySellWater = this.baseMapper.getCopyDailyFlowById(8, startDate, endDate);
        if (paiGuanZhanDailySellWater != null) {
            paiGuanZhanDailySellWaterMap =  paiGuanZhanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> zhiNanCunZongShuiBiaoDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> zhiNanCunZongShuiBiaoDailySellWater = this.baseMapper.getCopyDailyFlowById(20, startDate, endDate);
        if (zhiNanCunZongShuiBiaoDailySellWater != null){
            zhiNanCunZongShuiBiaoDailySellWaterMap =   zhiNanCunZongShuiBiaoDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> nanZhuangJiHuaLuDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> nanZhuangJiHuaLuDailySellWater = this.baseMapper.getCopyDailyFlowById(9, startDate, endDate);
        if (nanZhuangJiHuaLuDailySellWater != null){
            nanZhuangJiHuaLuDailySellWaterMap =  nanZhuangJiHuaLuDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xiQiaoPumpDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xiQiaoPumpDailySellWater = this.baseMapper.getCopyDailyFlowById(15, startDate, endDate);
        if (xiQiaoPumpDailySellWater != null){
            xiQiaoPumpDailySellWaterMap = xiQiaoPumpDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> jinShaDanZaoPumpDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> jinShaDanZaoPumpDailySellWater = this.baseMapper.getCopyDailyFlowById(13, startDate, endDate);
        if (jinShaDanZaoPumpDailySellWater != null){
            jinShaDanZaoPumpDailySellWaterMap =  jinShaDanZaoPumpDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object>  chanChengPumpDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> chanChengPumpDailySellWater = this.baseMapper.getCopyDailyFlowById(14, startDate, endDate);
        if ( chanChengPumpDailySellWater != null){
            chanChengPumpDailySellWaterMap =  chanChengPumpDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> pressurePumpDailySellWaterMap  = new ConcurrentHashMap<>();
        List<Pair<String, Object>> pressurePumpDailySellWater = this.baseMapper.getCopyDailyFlowById(12, startDate, endDate);
        if (pressurePumpDailySellWater != null){
            pressurePumpDailySellWaterMap =  pressurePumpDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        for (int i = 0;i<dateList.size();i++){
            WaterSellConditionOfEachFlowmeterVO VO =new WaterSellConditionOfEachFlowmeterVO();
            VO.setDateTime(dateList.get(i));
            VO.setSanShuiErQiaoNanDailySellWater((sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString())));
            VO.setQingQiDailySellWater((qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(qingQiDailySellWaterMap.get(dateList.get(i)).toString())));
            VO.setDongMenDailySellWater((dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danHengDailySellWaterMap.get(dateList.get(i)).toString())));
            VO.setDanHengDailySellWater((danHengDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danHengDailySellWaterMap.get(dateList.get(i)).toString())));
            VO.setJianShaDailySellWater((jianShaDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jianShaDailySellWaterMap.get(dateList.get(i)).toString())));
            VO.setYinHuiHuaTingDailySellWater((yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)).toString())));
            VO.setPaiGuanZhanDailySellWater((paiGuanZhanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(paiGuanZhanDailySellWaterMap.get(dateList.get(i)).toString())));
            VO.setZhiNanCunZongShuiBiaoDailySellWater((zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)).toString())));
            VO.setNanZhuangJiHuaLuDailySellWater((nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)).toString())));
            VO.setXiQiaoDailySellWater((xiQiaoPumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoPumpDailySellWaterMap.get(dateList.get(i)).toString()))*83/100);
            VO.setJinShaDanZaoDailyWaterOutlet((jinShaDanZaoPumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jinShaDanZaoPumpDailySellWaterMap.get(dateList.get(i)).toString())));
            VO.setChanChengWaterOutlet((chanChengPumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(chanChengPumpDailySellWaterMap.get(dateList.get(i)).toString()))*80/100);
            VO.setPressurePumpInlet((pressurePumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pressurePumpDailySellWaterMap.get(dateList.get(i)).toString())));
            resultList.add(VO);
        }
        return resultList;
    }



    @Override
    public List<PercentageOfWaterInEachAreaVO> getCopyPercentageOfWaterInEachArea(String startDate, String endDate) {
        List<PercentageOfWaterInEachAreaVO> resultList = new ArrayList<PercentageOfWaterInEachAreaVO>();
        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

        ConcurrentMap<String, Object> sanShuiErQiaoNanDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiErQiaoNanDailySellWater = this.baseMapper.getCopyDailyFlowById(3, startDate, endDate);
        if (sanShuiErQiaoNanDailySellWater != null){
            sanShuiErQiaoNanDailySellWaterMap =  sanShuiErQiaoNanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> qingQiDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> qingQiDailySellWater = this.baseMapper.getCopyDailyFlowById(4, startDate, endDate);
        if (qingQiDailySellWater != null){
            qingQiDailySellWaterMap = qingQiDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> dongMenDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> dongMenDailySellWater = this.baseMapper.getCopyDailyFlowById(19, startDate, endDate);
        if (dongMenDailySellWater != null){
            dongMenDailySellWaterMap =     dongMenDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));

        }

        ConcurrentMap<String, Object> danHengDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> danHengDailySellWater = this.baseMapper.getCopyDailyFlowById(5, startDate, endDate);
        if (danHengDailySellWater != null){
            danHengDailySellWaterMap =  danHengDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> jianShaDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> jianShaDailySellWater = this.baseMapper.getCopyDailyFlowById(6, startDate, endDate);
        if (jianShaDailySellWater != null){
            jianShaDailySellWaterMap =  jianShaDailySellWater
                    .stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> yinHuiHuaTingDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> yinHuiHuaTingDailySellWater = this.baseMapper.getCopyDailyFlowById(7, startDate, endDate);
        if (yinHuiHuaTingDailySellWater != null){
            yinHuiHuaTingDailySellWaterMap =  yinHuiHuaTingDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> paiGuanZhanDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> paiGuanZhanDailySellWater = this.baseMapper.getCopyDailyFlowById(8, startDate, endDate);
        if (paiGuanZhanDailySellWater != null) {
            paiGuanZhanDailySellWaterMap =  paiGuanZhanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> zhiNanCunZongShuiBiaoDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> zhiNanCunZongShuiBiaoDailySellWater = this.baseMapper.getCopyDailyFlowById(20, startDate, endDate);
        if (zhiNanCunZongShuiBiaoDailySellWater != null){
            zhiNanCunZongShuiBiaoDailySellWaterMap =   zhiNanCunZongShuiBiaoDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> nanZhuangJiHuaLuDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> nanZhuangJiHuaLuDailySellWater = this.baseMapper.getCopyDailyFlowById(9, startDate, endDate);
        if (nanZhuangJiHuaLuDailySellWater != null){
            nanZhuangJiHuaLuDailySellWaterMap =  nanZhuangJiHuaLuDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xiQiaoDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xiQiaoPumpDailySellWater = this.baseMapper.getCopyDailyFlowById(15, startDate, endDate);
        if (xiQiaoPumpDailySellWater != null){
            xiQiaoDailySellWaterMap = xiQiaoPumpDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }



        ConcurrentMap<String, Object> xjDailySellMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> copyXjDailySellList = this.baseMapper.getCopyXjDailySellList(startDate, endDate);
        if (copyXjDailySellList != null){
            xjDailySellMap = copyXjDailySellList.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        for (int i=0; i<dateList.size();i++){
            PercentageOfWaterInEachAreaVO VO = new PercentageOfWaterInEachAreaVO();
            VO.setDateTime(dateList.get(i));

            VO.setPercentageOfSanShui(((sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble( qingQiDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(dongMenDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())));

            VO.setPercentageOfDanZao(((danHengDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danHengDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (jianShaDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jianShaDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())));

            VO.setPercentageOfJinSha(((yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (paiGuanZhanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(paiGuanZhanDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())));

            VO.setPercentageOfChanCheng(((nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())));

            VO.setPercentageOfXiQiao(((xiQiaoDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailySellWaterMap.get(dateList.get(i)).toString()))*83/100)/
                    (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())));

            resultList.add(VO);
        }
        return resultList;
    }

    @Override
    public List<DailyFlowOfEachAreaVO> getCopyDailyFlowOfEachArea(String startDate, String endDate) {
        List<DailyFlowOfEachAreaVO> resultList = new ArrayList<DailyFlowOfEachAreaVO>();
        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

        ConcurrentMap<String, Object> sanShuiErQiaoNanDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiErQiaoNanDailySellWater = this.baseMapper.getCopyDailyFlowById(3, startDate, endDate);
        if (sanShuiErQiaoNanDailySellWater != null){
            sanShuiErQiaoNanDailySellWaterMap =  sanShuiErQiaoNanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> qingQiDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> qingQiDailySellWater = this.baseMapper.getCopyDailyFlowById(4, startDate, endDate);
        if (qingQiDailySellWater != null){
            qingQiDailySellWaterMap = qingQiDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> dongMenDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> dongMenDailySellWater = this.baseMapper.getCopyDailyFlowById(19, startDate, endDate);
        if (dongMenDailySellWater != null){
            dongMenDailySellWaterMap =     dongMenDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));

        }

        ConcurrentMap<String, Object> danHengDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> danHengDailySellWater = this.baseMapper.getCopyDailyFlowById(5, startDate, endDate);
        if (danHengDailySellWater != null){
            danHengDailySellWaterMap =  danHengDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> jianShaDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> jianShaDailySellWater = this.baseMapper.getCopyDailyFlowById(6, startDate, endDate);
        if (jianShaDailySellWater != null){
            jianShaDailySellWaterMap =  jianShaDailySellWater
                    .stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> yinHuiHuaTingDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> yinHuiHuaTingDailySellWater = this.baseMapper.getCopyDailyFlowById(7, startDate, endDate);
        if (yinHuiHuaTingDailySellWater != null){
            yinHuiHuaTingDailySellWaterMap =  yinHuiHuaTingDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> paiGuanZhanDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> paiGuanZhanDailySellWater = this.baseMapper.getCopyDailyFlowById(8, startDate, endDate);
        if (paiGuanZhanDailySellWater != null) {
            paiGuanZhanDailySellWaterMap =  paiGuanZhanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> zhiNanCunZongShuiBiaoDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> zhiNanCunZongShuiBiaoDailySellWater = this.baseMapper.getCopyDailyFlowById(20, startDate, endDate);
        if (zhiNanCunZongShuiBiaoDailySellWater != null){
            zhiNanCunZongShuiBiaoDailySellWaterMap =   zhiNanCunZongShuiBiaoDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> nanZhuangJiHuaLuDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> nanZhuangJiHuaLuDailySellWater = this.baseMapper.getCopyDailyFlowById(9, startDate, endDate);
        if (nanZhuangJiHuaLuDailySellWater != null){
            nanZhuangJiHuaLuDailySellWaterMap =  nanZhuangJiHuaLuDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xiQiaoDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xiQiaoPumpDailySellWater = this.baseMapper.getCopyDailyFlowById(15, startDate, endDate);
        if (xiQiaoPumpDailySellWater != null){
            xiQiaoDailySellWaterMap = xiQiaoPumpDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }



        ConcurrentMap<String, Object> nanJiang1DailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> nanJiang1DailySellWater = this.baseMapper.getCopyDailyFlowById(10, startDate, endDate);
        if (nanJiang1DailySellWater != null){
            nanJiang1DailySellWaterMap = nanJiang1DailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> nanJiang2DailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> nanJiang2DailySellWater = this.baseMapper.getCopyDailyFlowById(11, startDate, endDate);
        if (nanJiang2DailySellWater != null){
            nanJiang2DailySellWaterMap = nanJiang2DailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xj1CopyWaterSupportMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj1CopyWaterSupport = this.baseMapper.getCopyDailyFlowById(17, startDate, endDate);
        if (xj1CopyWaterSupport != null){
            xj1CopyWaterSupportMap = xj1CopyWaterSupport.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xj2CopyWaterSupportMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj2CopyWaterSupport = this.baseMapper.getCopyDailyFlowById(18, startDate, endDate);
        if (xj2CopyWaterSupport != null){
            xj2CopyWaterSupportMap = xj2CopyWaterSupport.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xjDailySellMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xjDailySell = this.baseMapper.getCopyXjDailySellList(startDate, endDate);
        if (xjDailySell != null){
            xjDailySellMap = xjDailySell.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        for (int i=0; i<dateList.size();i++){
            DailyFlowOfEachAreaVO VO = new DailyFlowOfEachAreaVO();
            VO.setDateTime(dateList.get(i));
            VO.setDailyFlowOfSanShui((sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(qingQiDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(dongMenDailySellWaterMap.get(dateList.get(i)).toString())));

            VO.setDailyFlowOfDanZao((danHengDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danHengDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (jianShaDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jianShaDailySellWaterMap.get(dateList.get(i)).toString())));

            VO.setDailyFlowOfJinSha((yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (paiGuanZhanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(paiGuanZhanDailySellWaterMap.get(dateList.get(i)).toString())));

            VO.setDailyFlowOfChanCheng((nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)).toString())));

            VO.setDailyFlowOfXiQiao((xiQiaoDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailySellWaterMap.get(dateList.get(i)).toString()))*83/100);

            VO.setXjTotalPWaterSellDaily((xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())));

            VO.setXjTotalPWaterSupportDaily((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString()))+(xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString())));

            VO.setNanJiangTotal((nanJiang1DailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(nanJiang1DailySellWaterMap.get(dateList.get(i)).toString()))+(nanJiang2DailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(nanJiang2DailySellWaterMap.get(dateList.get(i)).toString())));

            VO.setSaleOfDifference(VO.getXjTotalPWaterSupportDaily()-VO.getXjTotalPWaterSellDaily());
            resultList.add(VO);
        }
        return resultList;
    }

    @Override
    public List<MonthlyCumulativeWaterOfEachAreaVO> getCopyMonthlyCumulativeWaterOfEachArea(String startDate, String endDate) {
        List<MonthlyCumulativeWaterOfEachAreaVO> resultList = new ArrayList<MonthlyCumulativeWaterOfEachAreaVO>();

       /* Double CumulativeWaterOfSanShui = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfSanShui(startDate).toString());
        Double CumulativeWaterOfDanZao = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfDanZao(startDate).toString());
        Double CumulativeWaterOfJinSha = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfJinSha(startDate).toString());
        Double CumulativeWaterOfChanCheng = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfChanCheng(startDate).toString());
        Double CumulativeWaterOfXiQiao = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfXiQiao(startDate).toString());
        Double CumulativeWaterOfXjSupply = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfXjSupply(startDate).toString());
        Double CumulativeWaterOfXjSell =CumulativeWaterOfSanShui+CumulativeWaterOfDanZao+CumulativeWaterOfJinSha+CumulativeWaterOfChanCheng+CumulativeWaterOfXiQiao;
        Double CumulativeWaterOfXjDraw =Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfXjDraw(startDate).toString());*/

        Double CumulativeWaterOfSanShui = 0.0;
        Double CumulativeWaterOfDanZao =  0.0;
        Double CumulativeWaterOfJinSha =  0.0;
        Double CumulativeWaterOfChanCheng = 0.0;
        Double CumulativeWaterOfXiQiao =  0.0;
        Double CumulativeWaterOfXjSupply = 0.0;
        Double CumulativeWaterOfXjSell = 0.0;
        Double CumulativeWaterOfXjDraw = 0.0;

        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

        ConcurrentMap<String, Object> sanShuiErQiaoNanDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiErQiaoNanDailySellWater = this.baseMapper.getCopyDailyFlowById(3, startDate, endDate);
        if (sanShuiErQiaoNanDailySellWater != null){
            sanShuiErQiaoNanDailySellWaterMap =  sanShuiErQiaoNanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> qingQiDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> qingQiDailySellWater = this.baseMapper.getCopyDailyFlowById(4, startDate, endDate);
        if (qingQiDailySellWater != null){
            qingQiDailySellWaterMap = qingQiDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> dongMenDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> dongMenDailySellWater = this.baseMapper.getCopyDailyFlowById(19, startDate, endDate);
        if (dongMenDailySellWater != null){
            dongMenDailySellWaterMap =     dongMenDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));

        }

        ConcurrentMap<String, Object> danHengDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> danHengDailySellWater = this.baseMapper.getCopyDailyFlowById(5, startDate, endDate);
        if (danHengDailySellWater != null){
            danHengDailySellWaterMap =  danHengDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> jianShaDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> jianShaDailySellWater = this.baseMapper.getCopyDailyFlowById(6, startDate, endDate);
        if (jianShaDailySellWater != null){
            jianShaDailySellWaterMap =  jianShaDailySellWater
                    .stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> yinHuiHuaTingDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> yinHuiHuaTingDailySellWater = this.baseMapper.getCopyDailyFlowById(7, startDate, endDate);
        if (yinHuiHuaTingDailySellWater != null){
            yinHuiHuaTingDailySellWaterMap =  yinHuiHuaTingDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> paiGuanZhanDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> paiGuanZhanDailySellWater = this.baseMapper.getCopyDailyFlowById(8, startDate, endDate);
        if (paiGuanZhanDailySellWater != null) {
            paiGuanZhanDailySellWaterMap =  paiGuanZhanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> zhiNanCunZongShuiBiaoDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> zhiNanCunZongShuiBiaoDailySellWater = this.baseMapper.getCopyDailyFlowById(20, startDate, endDate);
        if (zhiNanCunZongShuiBiaoDailySellWater != null){
            zhiNanCunZongShuiBiaoDailySellWaterMap =   zhiNanCunZongShuiBiaoDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> nanZhuangJiHuaLuDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> nanZhuangJiHuaLuDailySellWater = this.baseMapper.getCopyDailyFlowById(9, startDate, endDate);
        if (nanZhuangJiHuaLuDailySellWater != null){
            nanZhuangJiHuaLuDailySellWaterMap =  nanZhuangJiHuaLuDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xiQiaoDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xiQiaoPumpDailySellWater = this.baseMapper.getCopyDailyFlowById(15, startDate, endDate);
        if (xiQiaoPumpDailySellWater != null){
            xiQiaoDailySellWaterMap = xiQiaoPumpDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xj1CopyWaterSupportMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj1CopyWaterSupport = this.baseMapper.getCopyDailyFlowById(17, startDate, endDate);
        if (xj1CopyWaterSupport != null){
            xj1CopyWaterSupportMap = xj1CopyWaterSupport.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xj2CopyWaterSupportMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj2CopyWaterSupport = this.baseMapper.getCopyDailyFlowById(18, startDate, endDate);
        if (xj2CopyWaterSupport != null){
            xj2CopyWaterSupportMap = xj2CopyWaterSupport.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }



        ConcurrentMap<String, Object> xjDailySellMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xjDailySell = this.baseMapper.getCopyXjDailySellList(startDate, endDate);
        if (xjDailySell != null){
            xjDailySellMap = xjDailySell.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xj1CopyWaterDrawDailyMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj1CopyWaterDrawDaily = this.baseMapper.getCopyDailyFlowById(1, startDate, endDate);
        if (xj1CopyWaterDrawDaily != null){
            xj1CopyWaterDrawDailyMap =  xj1CopyWaterDrawDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xj2CopyWaterDrawDailyMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj2CopyWaterDrawDaily = this.baseMapper.getCopyDailyFlowById(2, startDate, endDate);
        if (xj2CopyWaterDrawDaily != null){
            xj2CopyWaterDrawDailyMap = xj2CopyWaterDrawDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        for (int i = 0; i < dateList.size(); i++) {
            MonthlyCumulativeWaterOfEachAreaVO VO = new MonthlyCumulativeWaterOfEachAreaVO();
            CumulativeWaterOfSanShui += ((sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(qingQiDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danHengDailySellWaterMap.get(dateList.get(i)).toString())));

            CumulativeWaterOfDanZao +=((danHengDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danHengDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (jianShaDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jianShaDailySellWaterMap.get(dateList.get(i)).toString())));

            CumulativeWaterOfJinSha +=((yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (paiGuanZhanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(paiGuanZhanDailySellWaterMap.get(dateList.get(i)).toString())));

            CumulativeWaterOfChanCheng +=((nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)).toString())));

            CumulativeWaterOfXiQiao += ((xiQiaoDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xiQiaoDailySellWaterMap.get(dateList.get(i)).toString()))*83/100);

            CumulativeWaterOfXjSupply += ((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString()))+(xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString())));

            CumulativeWaterOfXjSell += ((xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())));

            CumulativeWaterOfXjDraw += ((xj1CopyWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterDrawDailyMap.get(dateList.get(i)).toString())) + (xj2CopyWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterDrawDailyMap.get(dateList.get(i)).toString())));

            VO.setDateTime(dateList.get(i));
            VO.setMonthlyCumulativeWaterOfSanShui(CumulativeWaterOfSanShui);
            VO.setMonthlyCumulativeWaterOfDanZao(CumulativeWaterOfDanZao);
            VO.setMonthlyCumulativeWaterOfJinSha(CumulativeWaterOfJinSha);
            VO.setMonthlyCumulativeWaterOfChanCheng(CumulativeWaterOfChanCheng);
            VO.setMonthlyCumulativeWaterOfXiQiao(CumulativeWaterOfXiQiao);
            VO.setXjCumulativePWaterSupportMonthly(CumulativeWaterOfXjSupply);
            VO.setXjCumulativePWaterSellMonthly(CumulativeWaterOfXjSell);
            VO.setXjCumulativeWaterDrawMonthly(CumulativeWaterOfXjDraw);
            resultList.add(VO);
        }
        return resultList;
    }



    @Override
    public List<SalesOutputRatioOfEachAreaVO> getCopySalesOutputRatioOfEachArea(String startDate, String endDate) {
        List<SalesOutputRatioOfEachAreaVO> resultList = new ArrayList<SalesOutputRatioOfEachAreaVO>();

        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);

       /* Double CumulativeWaterOfSanShui = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfSanShui(startDate).toString());
        Double CumulativeWaterOfDanZao = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfDanZao(startDate).toString());
        Double CumulativeWaterOfJinSha = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfJinSha(startDate).toString());
        Double CumulativeWaterOfChanCheng = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfChanCheng(startDate).toString());
        Double CumulativeWaterOfXiQiao = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfXiQiao(startDate).toString());
        Double CumulativeWaterOfXjSupply = Double.parseDouble(this.baseMapper.getCopyCumulativeWaterOfXjSupply(startDate).toString());
        Double CumulativeWaterOfXjSell =CumulativeWaterOfSanShui+CumulativeWaterOfDanZao+CumulativeWaterOfJinSha+CumulativeWaterOfChanCheng+CumulativeWaterOfXiQiao;
*/

        Double CumulativeWaterOfXjSupply = 0.0;
        Double CumulativeWaterOfXjSell =0.0;
        Double CumulativeWaterOfXjDraw = 0.0;

        ConcurrentMap<String, Object> sanShuiErQiaoNanDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> sanShuiErQiaoNanDailySellWater = this.baseMapper.getCopyDailyFlowById(3, startDate, endDate);
        if (sanShuiErQiaoNanDailySellWater != null){
            sanShuiErQiaoNanDailySellWaterMap =  sanShuiErQiaoNanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> qingQiDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> qingQiDailySellWater = this.baseMapper.getCopyDailyFlowById(4, startDate, endDate);
        if (qingQiDailySellWater != null){
            qingQiDailySellWaterMap = qingQiDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> dongMenDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> dongMenDailySellWater = this.baseMapper.getCopyDailyFlowById(19, startDate, endDate);
        if (dongMenDailySellWater != null){
            dongMenDailySellWaterMap =     dongMenDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));

        }

        ConcurrentMap<String, Object> danHengDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> danHengDailySellWater = this.baseMapper.getCopyDailyFlowById(5, startDate, endDate);
        if (danHengDailySellWater != null){
            danHengDailySellWaterMap =  danHengDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> jianShaDailySellWaterMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> jianShaDailySellWater = this.baseMapper.getCopyDailyFlowById(6, startDate, endDate);
        if (jianShaDailySellWater != null){
            jianShaDailySellWaterMap =  jianShaDailySellWater
                    .stream()
                    .collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> yinHuiHuaTingDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> yinHuiHuaTingDailySellWater = this.baseMapper.getCopyDailyFlowById(7, startDate, endDate);
        if (yinHuiHuaTingDailySellWater != null){
            yinHuiHuaTingDailySellWaterMap =  yinHuiHuaTingDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> paiGuanZhanDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> paiGuanZhanDailySellWater = this.baseMapper.getCopyDailyFlowById(8, startDate, endDate);
        if (paiGuanZhanDailySellWater != null) {
            paiGuanZhanDailySellWaterMap =  paiGuanZhanDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> zhiNanCunZongShuiBiaoDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> zhiNanCunZongShuiBiaoDailySellWater = this.baseMapper.getCopyDailyFlowById(20, startDate, endDate);
        if (zhiNanCunZongShuiBiaoDailySellWater != null){
            zhiNanCunZongShuiBiaoDailySellWaterMap =   zhiNanCunZongShuiBiaoDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> nanZhuangJiHuaLuDailySellWaterMap =new ConcurrentHashMap<>();
        List<Pair<String, Object>> nanZhuangJiHuaLuDailySellWater = this.baseMapper.getCopyDailyFlowById(9, startDate, endDate);
        if (nanZhuangJiHuaLuDailySellWater != null){
            nanZhuangJiHuaLuDailySellWaterMap =  nanZhuangJiHuaLuDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xj1CopyWaterSupportMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj1CopyWaterSupport = this.baseMapper.getCopyDailyFlowById(17, startDate, endDate);
        if (xj1CopyWaterSupport != null){
            xj1CopyWaterSupportMap = xj1CopyWaterSupport.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xj2CopyWaterSupportMap =  new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj2CopyWaterSupport = this.baseMapper.getCopyDailyFlowById(18, startDate, endDate);
        if (xj2CopyWaterSupport != null){
            xj2CopyWaterSupportMap = xj2CopyWaterSupport.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> xjDailySellMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xjDailySell = this.baseMapper.getCopyXjDailySellList(startDate, endDate);
        if (xjDailySell != null){
            xjDailySellMap = xjDailySell.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> jinShaDanZaoPumpDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> jinShaDanZaoPumpDailySellWater = this.baseMapper.getCopyDailyFlowById(13, startDate, endDate);
        if (jinShaDanZaoPumpDailySellWater != null){
            jinShaDanZaoPumpDailySellWaterMap = jinShaDanZaoPumpDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }



        ConcurrentMap<String, Object> chanChengPumpDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> chanChengPumpDailySellWater = this.baseMapper.getCopyDailyFlowById(14, startDate, endDate);
        if (chanChengPumpDailySellWater != null){
            chanChengPumpDailySellWaterMap = chanChengPumpDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        ConcurrentMap<String, Object> pressurePumpDailySellWaterMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> pressurePumpDailySellWater = this.baseMapper.getCopyDailyFlowById(12, startDate, endDate);
        if (pressurePumpDailySellWater != null){
            pressurePumpDailySellWaterMap =   pressurePumpDailySellWater.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xj1CopyWaterDrawDailyMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj1CopyWaterDrawDaily = this.baseMapper.getCopyDailyFlowById(1, startDate, endDate);
        if (xj1CopyWaterDrawDaily != null){
            xj1CopyWaterDrawDailyMap =xj1CopyWaterDrawDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }

        ConcurrentMap<String, Object> xj2CopyWaterDrawDailyMap = new ConcurrentHashMap<>();
        List<Pair<String, Object>> xj2CopyWaterDrawDaily = this.baseMapper.getCopyDailyFlowById(2, startDate, endDate);
        if(xj2CopyWaterDrawDaily != null){
            xj2CopyWaterDrawDailyMap =  xj2CopyWaterDrawDaily.stream().collect(Collectors.toConcurrentMap(Pair::getKey, Pair::getValue));
        }


        for (int i = 0; i < dateList.size(); i++){
            SalesOutputRatioOfEachAreaVO VO =new SalesOutputRatioOfEachAreaVO();

            CumulativeWaterOfXjSupply += ((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString()))+(xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString())));

            CumulativeWaterOfXjSell += ((xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString())));

            CumulativeWaterOfXjDraw += ((xj1CopyWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterDrawDailyMap.get(dateList.get(i)).toString())) + (xj2CopyWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterDrawDailyMap.get(dateList.get(i)).toString())));

            VO.setDateTime(dateList.get(i));
            VO.setDailyHighProductionAndSalesDiffer(((xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString()))-
                    (sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(qingQiDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(dongMenDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString()))*100);

            VO.setDailyLowProductionAndSalesDiffer(((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString()))-
                    (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString()))+
                    (sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(qingQiDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(dongMenDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString())));

            VO.setDailyLowLeakRate(((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString()))-
                    (pressurePumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pressurePumpDailySellWaterMap.get(dateList.get(i)).toString()))) / (xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString()))*100);

            VO.setDailyHighLeakRate(((xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString()))-
                    (sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString())) -
                    (qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(qingQiDailySellWaterMap.get(dateList.get(i)).toString())) -
                    (dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(dongMenDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString()))*100);

            VO.setDailyProductionAndSalesDifferOfPumpStation(((pressurePumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pressurePumpDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString()))+
                    (sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(qingQiDailySellWaterMap.get(dateList.get(i)).toString()))+
                    (dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(dongMenDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (pressurePumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(pressurePumpDailySellWaterMap.get(dateList.get(i)).toString()))*100);

            VO.setDailyProductionAndSalesDifferOfSanShui(((xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString()))-
                    (sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(sanShuiErQiaoNanDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (qingQiDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(qingQiDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (dongMenDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(dongMenDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString()))*100);

            VO.setDailyProductionAndSalesDifferOfJinSha(((jinShaDanZaoPumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jinShaDanZaoPumpDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (danHengDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(danHengDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (jianShaDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jianShaDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(yinHuiHuaTingDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (paiGuanZhanDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(paiGuanZhanDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (jinShaDanZaoPumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(jinShaDanZaoPumpDailySellWaterMap.get(dateList.get(i)).toString()))*100);

            VO.setDailyProductionAndSalesDifferOfChanCheng(((chanChengPumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(chanChengPumpDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(nanZhuangJiHuaLuDailySellWaterMap.get(dateList.get(i)).toString()))-
                    (zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(zhiNanCunZongShuiBiaoDailySellWaterMap.get(dateList.get(i)).toString())))/
                    (chanChengPumpDailySellWaterMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(chanChengPumpDailySellWaterMap.get(dateList.get(i)).toString()))*100);

            VO.setDailyProductionAndSalesDifferOfXiQiao(0.0);


            VO.setAccumulatedProductionAndSalesDiffer((CumulativeWaterOfXjSupply-CumulativeWaterOfXjSell)/CumulativeWaterOfXjSupply*100);

            VO.setDailyTotalProductionAndSalesDiffer(((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString())) +
                    (xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString())) -
                    (xjDailySellMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xjDailySellMap.get(dateList.get(i)).toString()))) /
                    ((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString())) +
                            (xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString()))) * 100);

            VO.setTapWater(((xj1CopyWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterDrawDailyMap.get(dateList.get(i)).toString()))+(xj2CopyWaterDrawDailyMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble( xj2CopyWaterDrawDailyMap.get(dateList.get(i)).toString())))-
                    ((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString())) + (xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString()))));

            VO.setTapWaterRate(VO.getTapWater()/((xj1CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj1CopyWaterSupportMap.get(dateList.get(i)).toString()))+
                    (xj2CopyWaterSupportMap.get(dateList.get(i)) == null ? 0.0 : Double.parseDouble(xj2CopyWaterSupportMap.get(dateList.get(i)).toString())))*100);

            VO.setCumulativeTapWaterRate( (CumulativeWaterOfXjDraw-CumulativeWaterOfXjSupply)/CumulativeWaterOfXjSupply*100);
            resultList.add(VO);
        }
        return resultList;
    }

   /* 公式修改*/
    @Override
    public List<MorningWaterVO> getCopyFlowRateOfEachFlowmeterAtDawn(String startDate, String endDate) {

        List<MorningWaterVO> resultList =new ArrayList<MorningWaterVO>();

        List<String> dateList = DateUtils.getBetweenDate(startDate, endDate);


        for (int i= 0; i<dateList.size();i++){
            MorningWaterVO VO = new MorningWaterVO();
            VO.setDateTime(dateList.get(i));
            resultList.add(VO);
        }
        return resultList;
    }

}

